using FreeSql.DataAnnotations;
using System;

namespace LF.Domain.Entities
{
    /// <summary>
    /// 物料实体
    /// </summary>
    public class Material : BaseEntity
    {
        /// <summary>
        /// 物料号
        /// </summary>
        [Column(IsNullable = false, StringLength = 50)]
        public string MaterialCode { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        [Column(IsNullable = false, StringLength = 200)]
        public string MaterialName { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        [Column(StringLength = 20)]
        public string? Unit { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        [Column(StringLength = 500)]
        public string? Specification { get; set; }

        /// <summary>
        /// 图片
        /// </summary>
        [Column(StringLength = 500)]
        public string? Image { get; set; }

        /// <summary>
        /// 是否易损件
        /// </summary>
        public bool IsVulnerable { get; set; }

        /// <summary>
        /// 更换周期（月）
        /// </summary>
        public int? ReplacementCycle { get; set; }

        /// <summary>
        /// 出产价格
        /// </summary>
        [Column(Precision = 18, Scale = 2)]
        public decimal? ProductionPrice { get; set; }

        /// <summary>
        /// 销售价格
        /// </summary>
        [Column(Precision = 18, Scale = 2)]
        public decimal? SalePrice { get; set; }

        /// <summary>
        /// 以旧换新价格
        /// </summary>
        [Column(Precision = 18, Scale = 2)]
        public decimal? TradeInPrice { get; set; }

        /// <summary>
        /// 状态（启用/禁用）
        /// </summary>
        public bool Status { get; set; } = true;

        /// <summary>
        /// 物料分类ID
        /// </summary>
        public Guid? MaterialCategoryId { get; set; }

        /// <summary>
        /// 物料分类（导航属性）
        /// </summary>
        [Navigate(nameof(MaterialCategoryId))]
        public MaterialCategory MaterialCategory { get; set; }
    }
} 